﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CutAways.Modeling
{
	[Serializable]
	public class Triangle
	{
		private int[] vertexIndices;				// Indexy pole vertexu.
		private int[] normalIndices;				// Indexy pole normal.
		private int[] textureCoordinateIndices;		// Indexy pole texturovych koordinatu.
		private int materialIndex;					// Index pouziteho materialu.
		private Vertex normal;						// Normala pro RenderModeFlat.

		public int[] VertexIndices
		{
			get { return vertexIndices; }
			set { vertexIndices = value; }
		}
		public int[] NormalIndices
		{
			get { return normalIndices; }
			set { normalIndices = value; }
		}
		public int[] TextureCoordinateIndices
		{
			get { return textureCoordinateIndices; }
			set { textureCoordinateIndices = value; }
		}
		public int MaterialIndex
		{
			get { return materialIndex; }
			set { materialIndex = value; }
		}
		public Vertex Normal
		{
			get { return normal; }
			set { normal = value; }
		}
		public Triangle(int materialIndex)
		{
			vertexIndices = new int[3];
			normalIndices = new int[3];
			textureCoordinateIndices = new int[3];

			for (int i = 0; i < 3; i++)
			{
				vertexIndices[i] = -1;
				normalIndices[i] = -1;
				textureCoordinateIndices[i] = -1;
			}

            this.materialIndex = materialIndex;
			normal = Vertex.Empty;
		}
	}
}
